import http from '../request.js'

/* 
所有服务类型查看
*/
export function selectAllType(data) {
  return http.request({
    url: '/admin/good/selectAllType',
    method: 'post',
    data
  })
}
/* 
查询服务类型详情
*/
export function selectTypeById(data) {
  return http.request({
    url: '/admin/good/selectTypeById',
    method: 'get',
    data
  })
}
/* 
服务类型删除*/
export function deleteType(data) {
  return http.request({
    url: '/admin/good/deleteType',
    method: 'post',
    data
  })
} /* 
    服务类型更新
    */
export function updateOrAddType(data) {
  return http.request({
    url: '/admin/good/updateOrAddType',
    method: 'post',
    data
  })
} /* 
    分页查询所有服务
    */
export function selectAllService(data) {
  return http.request({
    url: '/admin/good/selectAllService',
    method: 'post',
    data
  })
} /* 
    查看服务详情
    */
export function selectServiceById(data) {
  return http.request({
    url: '/admin/good/selectServiceById?id=' + data,
    method: 'get'
  })
}

export function selectServiceInfo(data) {
  return http.request({
    url: '/admin/good/servicesAuditInfo?id=' + data,
    method: 'get'
  })
}
/* 
    服务删除
    */
export function deleteService(data) {
  return http.request({
    url: '/admin/good/deleteService',
    method: 'post',
    data
  })
} /* 
    服务修改和添加
    */
export function updateAndAddService(data) {
  return http.request({
    url: '/admin/good/updateAndAddService',
    method: 'post',
    data
  })
}

// 上传服务封面
export function uploadPicture(data, name) {
  return http.request({
    url: '/admin/picture/uploadPicture?directoryName=' + name,
    method: 'post',
    data
  })
}

/* 
2022.5.12 阿里健康服务

*/

// 上下线产品--关联门店
export function online(data) {
  return http.request({
    url: '/admin/aliGood/online',
    method: 'post',
    data
  })
}

// 商品发布更新
export function publishGoods(data) {
  return http.request({
    url: '/admin/aliGood/publish',
    method: 'post',
    data
  })
}

// 查询商品详情
export function selectGoodDetailById(data) {
  return http.request({
    url: '/admin/aliGood/selectById?id=' + data,
    method: 'get'
  })
}
// 获取商品列表
export function getProductList(data) {
  return http.request({
    url: '/admin/aliGood/selectGood',
    method: 'post',
    data
  })
}

// 修改商品审核状态
export function updateGoodStatus(data) {
  return http.request({
    url: '/admin/aliGood/updateGoodStatus',
    method: 'get',
    data
  })
}

// 修改门店审核状态
export function updateShopStatus(data) {
  return http.request({
    url: '/admin/aliGood/updateShopStatus',
    method: 'get',
    data
  })
}

// 获取门店列表
export function getStoreList(data) {
  return http.request({
    url: '/admin/aliGood/selectAllShop',
    method: 'post',
    data
  })
}
// 根据ID查询门店详情

export function selectShopById(data) {
  return http.request({
    url: '/admin/aliGood/selectShopById?id=' + data,
    method: 'get',
    data
  })
}
// 更新上传门店
export function updateStore(data) {
  return http.request({
    url: '/admin/aliGood/update',
    method: 'post',
    data
  })
}

// 服务审核列表
export function servicesAuditList(data) {
  return http.request({
    url: '/admin/good/servicesAuditList',
    method: 'get',
    params: data
  })
}
// 服务审核列表详情
export function servicesAuditInfo(data) {
  return http.request({
    url: '/admin/good/servicesAuditInfo',
    method: 'get',
    params: data
  })
}

// 服务审核
export function serviceAudit(data) {
  return http.request({
    url: '/admin/good/serviceAudit',
    method: 'post',
    data
  })
}
// ---------------

// 添加或编辑一级分类信息
export function addServiceTypeParentInfo(data) {
  return http.request({
    url: '/admin/good/addServiceTypeParentInfo',

    method: 'post',
    data
  })
}

// 一级列表全部
export function queryserviceTypeParent() {
  return http.request({
    url: '/admin/good/queryserviceTypeParent',
    method: 'post'
  })
}
// 一级列表
export function serviceTypeParentList(data) {
  return http.request({
    url: '/admin/good/serviceTypeParentList',
    method: 'get',
    params: data
  })
}
// 一级服务删除
export function deleteServiceTypeParentInfo(data) {
  return http.request({
    url: '/admin/good/deleteServiceTypeParentInfo',
    method: 'post',
    data
  })
}
// 一级服务拖动
export function ServiceTypeParentSort(data) {
  return http.request({
    url: '/admin/good/ServiceTypeParentSort',
    method: 'post',
    data
  })
}

// 添加或编辑二级分类信息
export function editOraddServiceType(data) {
  return http.request({
    url: '/admin/good/editOraddServiceType',
    // method: 'get',
    // params:data
    method: 'post',
    data
  })
}

// 二级服务列表
export function serviceTypeList(data) {
  return http.request({
    url: '/admin/good/serviceTypeList',
    method: 'post',
    data
  })
}
// 二级服务删除
export function deleteServiceType(data) {
  return http.request({
    url: '/admin/good/deleteServiceType',
    method: 'post',
    data
  })
}

// 二级分类拖动排序
export function serviceTypeSort(data) {
  return http.request({
    url: '/admin/good/serviceTypeSort',
    method: 'post',
    data
  })
}
// 二级服务是否打开推荐
// 包含10个已推荐列表
export function popupList(data) {
  return http.request({
    url: '/admin/good/popupList',
    method: 'post',
    data
  })
}

export function saveSort(data) {
  return http.request({
    url: '/admin/good/saveSort',
    method: 'post',
    data
  })
}

export function serviceUpOrDown(data) {
  return http.request({
    url: '/admin/good/serviceUpOrDown',
    method: 'post',
    data
  })
}

export function updateGoodIsConsumable(params) {
  return http.request({
    url: '/admin/good/updateGoodIsConsumable',
    method: 'get',
    params
  })
}
//门店导入接口
export function excelPublishShopAPI(data) {
  return http.request({
    url: '/admin/aliGood/excelPublishShop',
    method: 'post',
    data
  })
}
//商品门店批量绑定
export function shopBindingGoodAPI(data) {
  return http.request({
    url: '/admin/aliGood/shopBindingGood',
    method: 'post',
    data
  })
}
//点击三级页面进入三级根据二级分类id找到二级分类对应服务admin/good/threeLevelServiceTypeList
export function threeLevelServiceTypeList(data) {
  return http.request({
    url: '/admin/good/threeLevelServiceTypeList',
    method: 'post',
    data
  })
}
//三级分类删除
export function deleteThreeLevelService(data) {
  return http.request({
    url: '/admin/good/deleteThreeLevelService',
    method: 'post',
    data
  })
}
//编辑三级分类信息
export function editOraddThreeLevelServiceType(data) {
  return http.request({
    url: '/admin/good/editOraddThreeLevelServiceType',
    method: 'post',
    data
  })
}
